import Vue from 'vue'
import moment from "moment"
function getMyDateEnd(str, str2) {
	var oDate = new Date(str);
	var oYear = oDate.getFullYear();
	var oMonth = oDate.getMonth() + 1;
	var oDay = oDate.getDate();
	var oTime = oYear + '/' + getzf(oMonth) + '/' + getzf(oDay) + ' ' + str2;
	return oTime;
}


export default {
	orderadd(state,val){
		state.order.push(val);
	},
	order(state,val){
		state.order = val;
	},
	heartmsg(state,val){
		state.heartmsg = val;
	},
	onceorder(state,val){
		state.order = [];
		for(let i =0; i<val.length; i++){
			let s = [1,1,val[i]['order_id'],1,val[i]['logo_url'],val[i]['order_no'],val[i]['transaction_id']];
			state.order.push(s);
		}
	},
	orderdel(state,val){
		for(let i =0; i<state.order.length; i++){
			if(val == state.order[i][2]){
				state.order.splice(i,1);
			}
			
		}
		
	},
	assetsupdate(state,val){
		state.userinfo.jine = val[2];
		state.userinfo.dongjie_jine = val[3];
		state.userinfo.today_earning = val[4];
		state.userinfo.today_ordernum = val[5];
		state.userinfo.total_earning = val[6];
		state.userinfo.ketixian = val[7];	
	},
	userinfo(state, val) {
		state.userinfo = val;
	},
	cardlist(state, val) {
		state.cardlist = val;
	},
	alldingdan(state, val) {
		state.alldingdan = val;
	},
	wancdingdan(state, val) {
		state.wancdingdan = val;
	},
	chaodingdan(state, val) {
		state.chaodingdan = val;
	},
	ploatformlist(state, val) {
		state.ploatformlist = val;
	},
	qrcodelist(state, val) {
		state.qrcodelist = val;
	},
	orderunderway(state, val) {
		state.orderunderway = val;
	},
	getbank(state, val) {
		state.getbank = val;
	},
	shouyi(state, val) {
		state.shouyi = val;
	},
	liushui(state, val) {
		state.liushui = val;
	},
	rujindetail(state, val) {
		state.rujindetail = val;
	},
	chujindetail(state, val) {
		state.chujindetail = val;
	},
	gonggao(state, val) {
		state.gonggao = val;
	},
	ifindex(state, val) {
		state.ifindex = val;
	},
	
	
	
	
	

}
